package com.hhk.transaction.web;

import com.hhk.transaction.model.Student;
import com.hhk.transaction.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class StudentController {
    @Autowired//在控制层调用业务层
    private StudentService studentService;

    @RequestMapping(value = "/update")
    public @ResponseBody Object update(Integer id,String name){
        Student student=new Student();
        student.setId(id);
        student.setName(name);
        int updateCount=studentService.queryStudentById(student);
        return "修改学生编号为"+id+"的姓名修改结果为："+updateCount;
    }
}
